<?php


namespace App\Http\Controllers\Api\Repositories;


use App\Models\WxPlate as Model;

class WxPlateRepositores
{
    /**
     * Model.
     *
     * @var string
     */
    protected $eloquentClass = Model::class;


    public function options()
    {
        global $__MINI_GLOBAL_TENANT_ID__;
        $query = (new $this->eloquentClass())->where('plate_state',1);
//        $query->where('tenant_id', $__MINI_GLOBAL_TENANT_ID__);
        $plate = $query->get(['id','plate_name']);
//        $arr = [];
//        foreach ($plate as $v){
//            $arr[$v['id']] = $v['plate_name'];
//        }
        return $plate;
    }


    public static function list()
    {
//        global $__MINI_GLOBAL_TENANT_ID__;
        $query = (new Model())->where('plate_state',1);
//        $query->where('tenant_id', $__MINI_GLOBAL_TENANT_ID__);
        return $query->orderBy('sort','desc')->get(['id','plate_name']);
    }
}
